﻿namespace DynaBoard
{
    using System;

    [IsRequired(true)]
    [MaxLength(128)]
    [RegexPattern("[^\x00-\x1f]{1,128}")]
    public class PostTitle : UserInputString
    {
        public PostTitle(string title)
            : base(title, true)
        { }

        public static implicit operator string(PostTitle title)
        {
            return title.value;
        }

        public static implicit operator PostTitle(string title)
        {
            return new PostTitle(title);
        }
    }
}